import { Context } from "koa";
import xss from "xss"
class Res {
  success(
    ctx: Context,
    data: any = [],
    msg: string = "success",
    code: number = 200
  ) {
    ctx.body = {
      data,
      msg,
      code,
    };
  }
  error(
    ctx: Context,
    msg: string = "error",
    code: number = 201
  ) {
    ctx.body = {
      msg,
      code,
    };
  }
}
let resp = new Res();
export { resp };
